$(document).ready(function() {
	$('.cancel-reply').live('click', function(){
		clearFormReply();
	});    
});
function validateFormComment(parent_id){
	check = true;

	// Validate content
	if ($(parent_id + ' #comment-post-content').val() == ''){
		$(parent_id + ' #comment-post-content-error').show();
		check	= false;
    }
	else {
		$(parent_id + ' #comment-post-content-error').hide();
	}

	// Validate name
	if ($(parent_id + ' #comment-name').length > 0 && $(parent_id + ' #comment-name').val() == ''){
		$(parent_id + ' #comment-name-error').show();
		check	= false;
    }
	else {
		$(parent_id + ' #comment-name-error').hide();
    }

    return check;
}
function clearFormReply() {
	$("#comment-post").show();
	$('.post-reply-comment').hide();
	$('.post-reply-comment').html('');
}
function resetFormComment() {
	clearFormComment();
	$("#comment-post").hide();
}
function clearFormComment() {
	if ($("#comment-post #comment-name").length > 0) {
		$("#comment-post #comment-name").val('');
		$("#comment-post #comment-email").val('');
		$('#comment-post #comment-name-error').hide();
	}
	$('#comment-post #comment-post-content-error').hide();
	$("#comment-post #comment-post-content").val('');
}